package com.innjia.sys.service.impl;

        import com.alibaba.druid.util.StringUtils;
import com.innjia.base.utils.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.innjia.sys.dao.ContractTemplateDao;
import com.innjia.sys.entity.ContractTemplateEntity;
import com.innjia.sys.service.ContractTemplateService;



@Service("contractTemplateService")
public class ContractTemplateServiceImpl implements ContractTemplateService {
	@Autowired
	private ContractTemplateDao contractTemplateDao;
	
	@Override
	public ContractTemplateEntity queryObject(String id){
		return contractTemplateDao.queryObject(id);
	}
	
	@Override
	public List<ContractTemplateEntity> queryList(Map<String, Object> map){
		return contractTemplateDao.queryList(map);
	}

    @Override
    public List<ContractTemplateEntity> queryListByBean(ContractTemplateEntity entity) {
        return contractTemplateDao.queryListByBean(entity);
    }
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return contractTemplateDao.queryTotal(map);
	}
	
	@Override
	public int save(ContractTemplateEntity contractTemplate){
		contractTemplate.setId(Utils.uuid());
		return contractTemplateDao.save(contractTemplate);
	}
	
	@Override
	public int update(ContractTemplateEntity contractTemplate){
        return contractTemplateDao.update(contractTemplate);
	}
	
	@Override
	public int delete(String id){
        return contractTemplateDao.delete(id);
	}
	
	@Override
	public int deleteBatch(String[] ids){
        return contractTemplateDao.deleteBatch(ids);
	}

	@Override
	public ContractTemplateEntity queryByContractType(String contractType) {
		if(StringUtils.isEmpty(contractType)) {
			return null;
		}
		return contractTemplateDao.queryByContractType(contractType);
	}
	
}
